package Book;

public class BookList {
    private Book[] books;
    private static final int DEFAULT_SIZE = 10;

    private int usedSize;


    public BookList() {
        this.books = new Book[DEFAULT_SIZE];

        //预存三本书
        this.books[0] = new Book("三国演义","罗贯中",19,"武侠");
        this.books[1] = new Book("西游记","吴承恩",20,"神话");
        this.books[2] = new Book("红楼梦","曹雪芹",15,"小说");

        this.usedSize = 3;
    }

    public Book[] getBooks() {
        return books;
    }
    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBooks(Book book, int pos) {
        books[pos] = book;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
